package it.multisystem.geometry;

import java.util.Collection;
import java.util.Vector;

public class Main {
	public static void main(String[] args) {
		Collection<Polygon> polygons = buildPolygons();
		
		print(polygons);
	}

	private static Collection<Polygon> buildPolygons() {
		Collection<Polygon> polygons = new Vector<Polygon>();
		
		polygons.add(new RegularTriangle("T1", 10));
		polygons.add(new Rectangle("R1", 10, 5));
		polygons.add(new Rectangle("R2", 11.5, 4));
		polygons.add(new RegularTriangle("T2", 40.2));
		polygons.add(new Rectangle("R2", 1.15, 100));
		polygons.add(new RegularTriangle("T3", 5));
		return polygons;
	}
	
	private static void print(Collection<Polygon> pols) {
		for (Polygon p : pols) {
			System.out.println(p.getName() + ", area = " + p.area() + ", perimeter = " + p.perimeter());
		}
	}
}
